import 'dart:async';

Future<Null> main() async {
  Stream<int> integers = deferredExecution();
  print('Just waiting for my stream...');
  await for (var x in integers) {
    print(x);
  }
}

Stream<int> deferredExecution() async* {
  for (var x = 5; x >= 0; x--) {
    yield x;
    // sleep for x seconds...
    await new Future.delayed(new Duration(seconds: x));
  }
}
//from:https://dev.to/jvarness/deferred-execution-and-darts-concurrency-model-27i
//EOP
